-- CALC_CAVE_36_TARGET_CLASS

-- 计算警卫室的中心格子类型
return function()
    local wreckage  = { ["class"] = 3012, ["ratio"] = 20 };    -- 研究员的残骸
    local wreckage2 = { ["class"] = 3023, ["ratio"] = 20 };    -- 神秘人的残骸
    local wreckage3 = { ["class"] = 3024, ["ratio"] = 20 };    -- 战警的残骸

    local chest      = { ["class"] = 3025, ["ratio"] = 20 };   -- 铁柜
    local chair      = { ["class"] = 3026, ["ratio"] = 20 };   -- 电椅
    local televation = { ["class"] = 3027, ["ratio"] = 20 };   -- 电视机
    local billiards  = { ["class"] = 3028, ["ratio"] = 20 };   -- 台球桌
    local guardchest = { ["class"] = 3029, ["ratio"] = 20 };   -- 警卫室铁柜

    local arr = { wreckage, wreckage2, wreckage3, chest, chair, televation, billiards, guardchest, };

    -- 神秘人和战警的残骸，一共只出现一次
    if DungeonInstanceM.getInstanceStat(wreckage2["class"]) > 0 or
        DungeonInstanceM.getInstanceStat(wreckage3["class"]) > 0 then
        wreckage2["ratio"] = 0;
        wreckage3["ratio"] = 0;
    end

    -- 迷宫小关不出现
    local dungeonId = DungeonM.getDungeonId();
    if type(dungeonId) == "number" and dungeonId > 0 and
        DungeonAreaM.query(dungeonId, "type") == "child" then
        wreckage2["ratio"] = 0;
        wreckage3["ratio"] = 0;
    end

    -- 先过滤一遍
    DungeonInstanceM.filterInstanceGrids(arr);

    local seed = DungeonM.getRandSeed("CALC_TENT_TARGET_CLASS");
    local info = fetchElemBySeed(arr, seed);

    return info["class"];
end
